﻿using CommandLine.Text;

namespace FileSubscriptionServer.Models
{
    public class UserInput
    {
        /// <summary>
        /// 关注的目录
        /// </summary>
        [CommandLine.Option('w', "watch", HelpText = "关注的目录")]
        public IEnumerable<string> WatchPaths { get; set; } = default!;

        /// <summary>
        /// 关注目录的配置文件
        /// </summary>
        [CommandLine.Option('c', "config", HelpText = "关注目录的配置文件")]
        public string WatchConfig { get; set; }



        public bool Check()
        {
            if (WatchPaths?.Any() == true)
                return true;

            if (string.IsNullOrEmpty(WatchConfig) != true && File.Exists(WatchConfig))
                return true;

            Console.WriteLine($"无法找到监控的目录也没有办法找到监控配置文件");

            return false;
        }
    }
}
